home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / misc / memtest8.000 / memtest8 / memtest86 / Makefile < prev    next >
Encoding:
Makefile  |  1996-05-29  |  2.4 KB  |  107 lines

  1. # Makefile for MemTest-86
  2. #
  3. # Author:        Chris Brady
  4. # Created:        January 1, 1996
  5. # Enhancements - V1.1:    May 28, 1996
  6.  
  7. #
  8. # Select Linux release (Must be set for loader compatibility. Only Releases
  9. # 1.2 and 1.3 are currently supported)
  10. #
  11. #REL_1.2=1
  12. REL_1.3=1
  13.  
  14. #
  15. # Path for the floppy disk device
  16. #
  17. FDISK=/dev/fd0
  18.  
  19. #
  20. # Comment out the following to disable testing without cache
  21. #
  22. CACHE=-DCACHE
  23.  
  24. #
  25. # Comment out the following to disable testing with long refresh timing
  26. #
  27. REFRESH=-DREFRESH
  28.  
  29. #
  30. # gcc compiler options, these settings should suffice
  31. #
  32. CCFLAGS=-m486 -O2
  33.  
  34. all: setup bootsect head build
  35. ifdef REL_1.3
  36.  
  37.     objdump -k -q -o 0x0100 head >head.out
  38.     ./build bootsect setup head.out >image
  39. else
  40.     ./build bootsect setup head >image
  41. endif
  42.  
  43. mtest.o: mtest.c mtest.h
  44.     cc -c $(CCFLAGS) $(REFRESH) $(CACHE) mtest.c
  45.  
  46. # Warning - Read the following carefully if you modify the code in any way!
  47. #
  48. # The "-Ttext" option for ld sets the origin for the text segment. This
  49. # must match the adrs where the code will execute (TESTADR in mtest.h). 
  50. # However, in Linux 1.2 ld introduces an offset of 0x20 so the
  51. # specified address must be set to TESTADR - 0x20. Ugly!!
  52. #
  53. # The "-Tdata" option for ld sets the origin for the data segment. This is
  54. # is set by hand and will need to be adjusted if the code grows much at all.
  55. # The current settings leave only a small amount of room for growth. Look at
  56. # the loader map to check this address.  In addition you may need to adjust
  57. # the starting test address (START_ADR in mtest.h) to the end address of the
  58. # test + ~0x20.  Again consult the loader map.
  59. #
  60. head: head.o mtest.o
  61. ifdef REL_1.3
  62.     ld -m elf_i386 -o $@ -e do_test -Ttext 0x0100 -Tdata 0x0cc0 -Map mapfile head.o mtest.o
  63. else
  64.     ld -o $@  -qmagic -Map mapfile -Ttext 0x00e0 -Tdata 0x0cc0 head.o mtest.o
  65. endif
  66.  
  67. head.o: head.s
  68.     as -o $@ $<
  69.  
  70. head.s: head.S mtest.h
  71.     cc -E -traditional $< -o $@
  72.  
  73. setup: setup.o
  74.     ld86 -0 -s -o $@ $<
  75.  
  76. setup.o: setup.s
  77.     as86 -a -0 -o $@ $<
  78.  
  79. setup.s: setup.S mtest.h
  80.     cc -E -traditional $< -o $@
  81.  
  82. bootsect: bootsect.o
  83.     ld86 -0 -s -o $@ $<
  84.  
  85. bootsect.o: bootsect.s
  86.     as86 -a -0 -o $@ $<
  87.  
  88. bootsect.s: bootsect.S mtest.h
  89.     cc -E -traditional $< -o $@
  90.  
  91. build:    build.c
  92. ifdef REL_1.3
  93.     cc -DELF -o build build.c
  94. else
  95.     cc -o build build.c
  96. endif
  97.  
  98. clean:
  99.     rm -f *.o *.s build image bootsect setup head head.out mapfile
  100.  
  101. install: all
  102.     dd <image >$(FDISK) bs=8192
  103.  
  104. install-bin:
  105.     dd <image.bin >$(FDISK) bs=8192
  106.  
  107.